{extend name="base" /} {block name="body"}
<div class="layui-body">
	<!--tab标签-->
	<div class="layui-tab layui-tab-brief">
		<ul class="layui-tab-title">
			<li class="layui-this">产品管理</li>
			<li class="">
				<a href="{:url('admin/goods/add')}">添加产品</a>
			</li>
			<li class="">
				<a href="{:url('/admin/category')}">分类管理</a>
			</li>
		</ul>
		<div class="layui-tab-content">
			<div class="layui-tab-item layui-show">

				<form class="layui-form layui-form-pane" action="{:url('admin/goods/index')}" method="get">
					<div class="layui-inline">
						<label class="layui-form-label">关键词</label>
						<div class="layui-input-inline">
							<input type="text" name="keyword" value="{$keyword}" placeholder="请输入关键词" class="layui-input">
						</div>
					</div>
					<div class="layui-inline">
						<label class="layui-form-label">分类</label>
						<div class="layui-input-inline">
							<select name="cate_id" lay-verify="required">
								<option value="">所有分类</option>
								{foreach name="category_level_list" item="vo"}
								<option value="{$vo.id}" {if $vo.id==$cate_id}selected{/if}>{neq name="vo.level" value="1"}| {php}for($i=1;$i
									<$vo[ 'level'];$i++){echo ' ----';}{/php}{/neq} {$vo.name}</option>
										{/foreach}
							</select>
						</div>
					</div>
					<div class="layui-inline">
						<button class="layui-btn">搜索</button>
					</div>
				</form>
				<hr>

				<table class="layui-table">
					<thead>
						<tr>
							<th>ID</th>
							<th width="100">图片</th>
							<th>标题</th>
							<th>访问量</th>
							<th>点赞数</th>
							<th>是否显示</th>
							<th>创建时间</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody>
						{foreach name="list" item="vo"}
						<tr>
							<td>{$vo.id}</td>
							<td><img src="{$vo.thumb}" class="thumb"/></td>
							<td>{$vo.title}</td>
							<td>{$vo.clicks}</td>
							<td>{$vo.praise}</td>
							<td>{if $vo.status==1}显示{else/}隐藏{/if}</td>
							<td>{$vo.add_time}</td>
							<td>
								<a href="{:url('admin/goods/update',['id'=>$vo['id']])}" class="layui-btn layui-btn-normal layui-btn-small">编辑</a>
								<a href="{:url('admin/goods/delete',['id'=>$vo['id']])}" class="layui-btn layui-btn-danger layui-btn-small ajax-delete">删除</a>
							</td>
						</tr>
						{/foreach}
					</tbody>
				</table>
				<!--分页-->
				{$list->render()}
			</div>
		</div>
	</div>
</div>
{/block}